import fetch, { BaseResponse, loginUrl } from '../api/index';
import { ResCurrentUser } from '@/domain/authority/types/auth/auth';

export async function verify(token: string): Promise<BaseResponse<string>> {
  const { data } = await fetch.get<BaseResponse<string>>('/haichuan/assembly/sso/verify', { token });
  return data;
}

export async function getLogoutUrl(): Promise<BaseResponse<string>> {
  const { data } = await fetch.get<BaseResponse<string>>('/haichuan/assembly/logout', {});
  return data;
}

/**
 * 获取用户列表
 * @param  ReqUserParam
 * @returns ResUser
 */
export async function getCurrentUser(): Promise<BaseResponse<ResCurrentUser>> {
  const { data } = await fetch.get<BaseResponse<ResCurrentUser>>('/haichuan/assembly/userinfo', {});
  return data;
}
